package com.qfedu.lc.api.user.feigin;

import com.qfedu.lc.api.config.OpenFeignConfig;
import com.qfedu.lc.common.param.UserAdd;
import com.qfedu.lc.common.param.UserLogin;
import com.qfedu.lc.common.vo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

/**
 * 配置当前的feign客户端 绑定  OpenFeignConfig.class ，作用就将前端的Lctoken 转交给远程feign客户端
 */
@FeignClient(value = "lc-userserver",configuration= OpenFeignConfig.class)
public interface UserService {



    /**注册用户
     * @param userAdd
     * @param request
     * @return
     */
    @PostMapping("/server/user/registerUser")
    public R registerUser(@RequestBody UserAdd userAdd);


    /**
     * 使用用户名密码登录
     * @param userLogin
     * @return
     */
    @PostMapping("/server/user/loginpass")
    public R loginPass(@RequestBody UserLogin userLogin);

    /**
     * 退出登录
     * @return
     */
    @GetMapping("/server/user/logout")
    public R logout();


}
